﻿@using Microsoft.AspNetCore.Hosting
@using Microsoft.Extensions.DependencyModel
@inject IWebHostEnvironment Environment

@using System.Reflection
@{
    ViewData["Title"] = "控制面板";
    Layout = "~/Views/Shared/_ManageIndexLayout.cshtml";

    var assembly = Assembly.GetExecutingAssembly();
    var attributes = assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
    var v = string.Empty;
    if (attributes.Length > 0)
    {
        v = ((AssemblyFileVersionAttribute)attributes[0]).Version;
    }
}




<div class="mdui-container-fluid">

    <div class="mdui-row">

        <div class="mdui-col-xs-12 mdui-col-md-6">
            <div class="mdui-card mdui-m-t-1 mdui-color-white" style="border-radius:5px;">
                <div class="mdui-card-content">
                    <ul class="mdui-list">
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">android</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">App名称</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">@Environment.ApplicationName</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">code</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">内部版本号</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">@v</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">view_array</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">运行环境</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">@Environment.EnvironmentName</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">phonelink_lock</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">授权方式</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">许可证授权</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">lock_open</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">许可证到期日</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">无期限</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">pages</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">操作系统</div>
                                <div class="mdui-list-item-text mdui-list-item-one-line">@System.Environment.OSVersion</div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                        <li class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">keyboard</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-title mdui-list-item-one-line">Core环境</div>
                                <div class="mdui-list-item-text">
                                    @DependencyContext.Default.Target.Framework
                                    @{
                                        var sb = new System.Text.StringBuilder();
                                        DependencyContext.Default.RuntimeLibraries
                                                .Where(x => x.Name.Contains("Microsoft.NETCore.App"))
                                                .ToList()
                                                .ForEach(x =>
                                                {
                                                    sb.Append("<br /><span>" + x.Name + ":" + x.Version + "</span>");
                                                });
                                    }
                                    @Html.Raw(sb.ToString())
                                </div>
                            </div>
                        </li>
                        <li class="mdui-divider-inset mdui-m-y-0"></li>
                    </ul>
                </div>
            </div>
            

        </div>


    </div>




</div>


